package cn.iocoder.yudao.module.promotion.linkage21.controller.app;

import cn.iocoder.yudao.framework.business.basic.annotation.AppJsonView;
import cn.iocoder.yudao.framework.business.basic.controller.PageController;
import cn.iocoder.yudao.framework.business.basic.controller.SimpleDetailController;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.linkage21.pojo.dto.Linkage21ProductQueryDTO;
import cn.iocoder.yudao.module.promotion.linkage21.pojo.vo.Linkage21ProductVO;
import cn.iocoder.yudao.module.promotion.linkage21.service.Linkage21ProductService;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 前端控制器
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/04/10
 */
@Tag(name = "用户 App - 链动2+1产品")
@RestController("appLinkage21ProductController")
@RequestMapping("/promotion/linkage21/product")
public class Linkage21ProductController implements SimpleDetailController<Linkage21ProductVO>, PageController<Linkage21ProductVO, Linkage21ProductQueryDTO> {
    @Resource
    private Linkage21ProductService linkage21ProductService;

    @JsonView(AppJsonView.class)
    @Override
    public CommonResult<Linkage21ProductVO> getDetail(Long id) {
        return CommonResult.success(linkage21ProductService.getDetail(id));
    }

    @JsonView(AppJsonView.class)
    @Override
    public CommonResult<PageResult<Linkage21ProductVO>> getPage(Integer pageNo, Integer pageSize, Linkage21ProductQueryDTO param) {
        return CommonResult.success(linkage21ProductService.getPage(pageNo, pageSize, param));
    }

}
